package com;

import javax.sql.DataSource;
import java.sql.Connection;

public class DataBean {
	private DataSource dataSource;

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

	public void testDataSource() {
		try {
			Connection connection = dataSource.getConnection();
			if (connection != null)
				System.out.println("test ok!");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
